package org.example.json.valueobject;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import org.example.json.inspect.Probe;

@Getter
@EqualsAndHashCode
@JsonDeserialize(builder = Order.OrderBuilder.class)
public class Order {
    private String orderNo;
    private Product product;
    private Customer customer;

    @Builder(setterPrefix = "")
    public Order(String orderNo, Product product, Customer customer) {
        Probe.run(Order.class, orderNo, product, customer);
        this.orderNo = orderNo;
        this.product = product;
        this.customer = customer;
    }

    @JsonPOJOBuilder(withPrefix = "")
    public static class OrderBuilder {
    }
}
